<template>
  <div class="recharge-confirm-container">
    <m-header title="充值">
      <span class="header-right" slot="right">联系客服</span>
    </m-header>
    <div class="header">
      <img :src="paySrc" alt>
      {{payLabel}}
    </div>
    <div class="divider"></div>
    <div class="bottom">
      <div class="money">
        ¥
        <span>{{price}}</span>
      </div>
      <div class="barcode">
        <img :src="paySrc" alt>
      </div>
      <div class="button-wrapper">
        <div class="btn">启动{{payName}}APP</div>
      </div>
      <div class="text">
        <div class="blue">如果不能启动{{payName}}APP，请按下面步骤</div>
        <div class="black">1：请先截屏保存二维码到手机</div>
        <div class="black">：打开{{payName}}，扫一扫本地图片</div>
      </div>
      <div class="text">
        <div class="blue">付款即时到账，未到账请联系我们</div>
        <div class="black">订单：CZ24239473487438954355</div>
      </div>
    </div>
  </div>
</template>
<script>
const payObj = {
  '2': {
    label: '微信支付',
    src: require('../../../assets/imgs/mine/wechat@2x.png'),
    name: '微信'
  },
  '1': {
    label: '支付宝',
    src: require('../../../assets/imgs/mine/zhifubao@2x.png'),
    name: '支付宝'
  },
  '3': {
    label: '银行卡',
    src: require('../../../assets/imgs/mine/yinlian@2x.png'),
    name: '银联'
  }
}
export default {
  data () {
    return {
      payLabel: '',
      paySrc: null,
      payName: ''
    };
  },
  created () {
    const { type, price } = this.$route.params || {};
    const { label, src, name } = payObj[type];
    this.price = price;
    this.payLabel = label;
    this.paySrc = src;
    this.payName = name;
  }
};
</script>
<style lang="less">
.recharge-confirm-container {
  padding-top: 0.92rem;
  padding-bottom: 0.2rem;
  background: #ffffff;
  height: 100%;
  .header-right {
    color: #ffffff;
    font-size: 0.3rem;
  }
  .header {
    height: 1rem;
    line-height: 1rem;
    text-align: center;
    color: #333333;
    font-size: 0.28rem;
    img {
      width: 0.8rem;
      margin-right: 0.2rem;
    }
  }
  .divider {
    height: 0.2rem;
    background: #f7f7f7;
  }
  .bottom {
    text-align: center;
    .money {
      margin-top: 0.44rem;
      margin-bottom: 0.13rem;
      color: #333333;
      font-size: 0.35rem;
      height: 0.7rem;
      line-height: 0.7rem;
      span {
        color: #d0021b;
        font-size: 0.5rem;
        margin-left: 0.16rem;
      }
    }
    .barcode {
      img {
        width: 3.2rem;
      }
    }
    .button-wrapper {
      margin-top: 0.6rem;
      margin-bottom: 0.44rem;
      padding: 0 0.26rem;
      .btn {
        text-align: center;
        height: 1rem;
        line-height: 1rem;
        font-size: 0.34rem;
        color: #ffffff;
        background: #d44743;
        cursor: pointer;
        border-radius: 0.06rem;
      }
    }
    .text {
      margin-bottom: 0.37rem;
      .blue {
        font-size: 0.28rem;
        color: #3f8feb;
        height: 0.4rem;
      }
      .black {
        font-size: 0.26rem;
        margin-top: 0.06rem;
        color: #333333;
        height: 0.37rem;
      }
    }
  }
}
</style>
